SYNTAX.TXT (The Amateur Reasoner v1.7.0) Norman Newman Kibbutz Tsor'a MP Shimshon 99705 Israel November 1990 This document explains the syntax needed for rule files which are used as input for the Amateur Reasoner inference engine. The syntax is described here using Backus-Naur form, where ::= denotes 'is equivalent to' | denotes 'or' indicates that 'text' must appear literally. program ::= statements statements ::= stmt | stmt statements stmt ::= rule | goal | prompt | comment | intro rule ::= prem prem <.> prem ::= premise | premise <&> prem premise ::= text <=> text goal ::= token <)> prompt ::= text <) = > text intro ::= text <.> comment ::= text text ::= token | token text token ::= any combination of alphanumeric characters upto a maximum length of 255. A token may not include the characters ( ) , . = & ? ! Of the five kinds of statement, the goal statement must appear only once; a second goal statement will be flagged as an error but ignored. The 'intro' statement is optional, but if it appears, it may do so only once; more than one intro statement is a fatal parsing error. All the other statement forms are optional, although a rule file without rules is not very useful. Comments may be inserted anywhere in the program (although not inside tokens) and are delimited by exclamation marks (!). Comments may not be nested. It should be noted that comments add to the clarity of a program but cause slower parsing. The Amateur Reasoner is case sensitive, although the four keywords (if, goal, prompt and goal) may be entered in upper or lower case. Rule files are free-form ASCII files and empty lines or indentation may be introduced at will to enhance readability. The file 'animal' is an example of a rule file which demonstrates the syntactic forms and rules. The program is invoked by simply typing 'amateur' at the DOS prompt. The name of the rule file may be passed as an optional parameter; the program will prompt for a rule file if one is not given. There is no default extension for the rule file. If the environmental variable EXPERT$ is defined (by adding the line 'SET EXPERT$=' to your AUTOEXEC.BAT file), the program will be able to find your rule files without difficulty. If this variable is not defined, and the rule file is not in the current directory, its name must be prefaced with its complete path. Examples of invocation - C> amateur animal C> amateur C> amateur c:\ai\animal Comments, queries and bug reports are cordially invited (although I hope that there won't be any of the third category!).